<template>
  <nav v-if="$route.meta.showNav">
    <head-nav></head-nav>
  </nav>
  <router-view :key="routerKey"/>
</template>

<script lang="ts">
import HeadNav from './components/NavBar.vue'
import { useRoute } from 'vue-router'
import { computed } from 'vue'
export default {
  components: { HeadNav },
  setup () {
    const route = useRoute()
    const routerKey = computed(() => {
      return route.path + Math.random()
    })
    return {
      routerKey
    }
  }
}
</script>

<style lang="less">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}
</style>
